/* 主题变量与暗色模式支持 */
:root {
  --color-bg: #f6f7f9;
  --color-surface: #ffffff;
  --color-text: #1f2937;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-accent: #4f46e5;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme='dark'] {
  --color-bg: #0f1216;
  --color-surface: #12161b;
  --color-text: #e5e7eb;
  --color-muted: #9ca3af;
  --color-border: #1f2937;
  --color-accent: #7c3aed;
}

body {
  margin: auto;
  position: relative;
  overflow: none;
  background: var(--color-bg);
  color: var(--color-text);

  /* Use System Fonts */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans',
    'Droid Sans', 'Helvetica Neue', sans-serif !important;
}

#photon-window {
  z-index: 400;
}

path {
  stroke: #fff;
  fill-rule: evenodd;
}

circle,
path {
}

circle {
  pointer-events: all;
  fill: #eee;
  opacity: 0.2;
}

circle:hover {
  fill: none;
}

#core:hover {
  opacity: 0.5;
  cursor: pointer;
}

/* treemap */

/*
rect {
  fill: none;
  pointer-events: all;
}

pre {
  font-size: 18px;
}

line {
  stroke: #000;
  stroke-width: 1.5px;
}

.string,
.regexp {
  color: #f39;
}

.keyword {
  color: #00c;
}

.comment {
  color: #777;
  font-style: oblique;
}

.number {
  color: #369;
}

.class,
.special {
  color: #1181b8;
}
*/

/* end treemap */

.cell > rect:hover {
  fill: yellow;
}

/* flame graph tool tip */
.d3-flame-graph-tip {
  z-index: 1000;
}

/* legend */

#explanation {
  position: absolute;
  /*top: 260px;
  left: 305px*/
  width: 140px;
  height: 140px;
  margin: auto;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  text-align: center;
  color: #333;
  z-index: -1;
  /*z-index: -1;*/

  font-weight: 200;
}

#core_top {
  font-size: 1.3em;
}

#core_center {
  font-size: 2em;
}

#legend {
  text-align: center;
  padding-top: 20px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  z-index: 50;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  display: none;
}

#legend h2 {
  font-size: 1.2em;
  font-style: inherit;
  margin: 0;
  padding: 0;
  /*text-transform: uppercase;
  font-variant:small-caps;*/
}
#legend p {
  font-size: 0.9em;
  margin: 0;
  padding: 0;
}

#loading {
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: fixed;
  display: inline-block;
  margin: auto;
  z-index: 250;
  width: 100px;
  height: 100px;
  display: none;
}

.area {
  /*opacity: 0.8;*/
  cursor: pointer;
}

.area:hover {
  stroke: #999;
  stroke-width: 2px;
  opacity: 1;
}

#flame-graph {
  display: inline-block;
  position: relative;
  width: 100%;
  vertical-align: top;
}

.svg-container {
  display: inline-block;
  position: relative;
  width: 100%;
  /*padding-bottom: 100%;*/ /* aspect ratio */
  vertical-align: top;
  overflow: hidden;
}

.svg-content-responsive {
  display: inline-block;
  position: absolute;
  /*top: 10px;*/
  /*left: 0;*/
}

#sequence {
  /*display: inline-block;*/
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 100;
  /*width: 600px;
  height: 70px;*/
}

#chart {
  position: relative;
}

#chart path {
  stroke: #fff;
}

/* Side bar */
#sidebar {
  z-index: 100;
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  transition: width 0.6s;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
}

#sidebar:hover {
  width: 400px;
}

.nav-group-item:hover {
  background: rgba(79, 70, 229, 0.08);
}

/* Center aligned Flex Box */

.Aligner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.Aligner-item {
  max-width: 50%;
  background: var(--color-surface);
  opacity: 1;
  border-radius: 10px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

/* 工具栏与按钮细节优化 */
.toolbar.toolbar-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.toolbar .title {
  font-weight: 600;
  color: var(--color-text);
}

.btn.btn-default {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.btn.btn-default.active,
.btn.btn-default:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.mode_buttons.btn {
  width: 42px;
  height: 36px;
}

.Aligner-item--top {
  align-self: flex-start;
}

.Aligner-item--bottom {
  align-self: flex-end;
}

#shades {
  z-index: 200;
  width: 100%;
  height: 100%;
  background: #333;
  /*opacity: 0.3;*/
  position: absolute;
  display: none;
}

#promptbox {
  width: 100%;
  height: 400px;
  text-align: center;
  padding: 20px;
  height: 200px;
}

#bottom_status {
  overflow: hidden;
  text-overflow: ellipsis;
  /* todo some kind of flex width */
}
